<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		<TITLE>用户登录</TITLE>
		<LINK href="images/User_Login.css" type=text/css rel=stylesheet>
		<META http-equiv=Content-Type content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css"
			href="ext/resources/css/ext-all.css" />
		<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="ext/ext-all-debug.js"></script>
		<script type='text/javascript' src='/lawyerManager/dwr/interface/loginDispose.js'></script>
		<script type='text/javascript' src='dwr/engine.js'></script>
		<script type='text/javascript' src='dwr/util.js'></script>
		<script type="text/javascript">
 var autoflag;
Ext.onReady(function(){

        Ext.get('IbtnEnter').on('click', function(){
        loginRequest();

         Ext.MessageBox.show({
           title: '请稍候...',
           msg: '正在请求中...',
           width:240,
           progress:true,
           closable:false,
           animEl: 'IbtnEnter'
       });

       // this hideous block creates the bogus progress
       var f = function(v){

            return function(){
                if(v == 11){
                    Ext.MessageBox.hide();
                }else{
                    Ext.MessageBox.updateProgress(v/10, '验证您的信息中，进度 ' + v + ' / 10...');
                }
           };

       };

       for(var i = 1; i < 12; i++){
           autoflag=setTimeout(f(i), i*300);
       }
    });


    });

//发送用户登陆请求
 function loginRequest(){
		var userName=dwr.util.getValue("TxtUserName");
		var userPwd=dwr.util.getValue("TxtPassword");
		var role=dwr.util.getValue("role");
		//调用服务器上用户登陆验证的方法
		loginDispose.loginValidate(userName,userPwd,role,callBack);
		}

//回调函数
function callBack(data){
          var loginResult=jstrim(data);
          if(loginResult=="ok"){
         	 window.location.href='index.jsp';
          }
          else{
         	Ext.MessageBox.alert("登陆失败","请验证输入的信息是否正确！");
          }
		}

//去掉字符串的首尾空格
function jstrim(s)
 			 {
 				 return   s.replace(/(^\s*)|(\s*$)/g,"");
 			 }

		</script>
	</HEAD>
	<BODY id=userlogin_body>
		<DIV id=user_login>
			<DL>
				<DD id=user_top>
					<UL>
						<LI class=user_top_l>
						</LI>
						<LI class=user_top_c>
						</LI>
						<LI class=user_top_r>
						</LI>
					</UL>
				<DD id=user_main>
					<UL>
						<LI class=user_main_l>
						</LI>
						<LI class=user_main_c>
							<DIV class=user_main_box>
								<UL>
									<LI class=user_main_text>
										用户名：
									</LI>
									<LI class=user_main_input>
										<INPUT class=TxtUserNameCssClass id=TxtUserName maxLength=20
											name=TxtUserName type="text">
									</LI>
								</UL>
								<UL>
									<LI class=user_main_text>
										密 码：
									</LI>
									<LI class=user_main_input>
										<INPUT class=TxtPasswordCssClass id=TxtPassword type=password
											name=TxtPassword>
									</LI>
								</UL>
								<UL>
									<LI class=user_main_text>
										用户：
									</LI>
									<LI class=user_main_input>
										<SELECT id=role name=role>
											<OPTION value="1" selected>
												律师
											</OPTION>
											<OPTION value="4">
												行政人员
											</OPTION>
										</SELECT>
									</LI>
								</UL>
							</DIV>
						</LI>
						<LI class=user_main_r>
							<INPUT class=IbtnEnterCssClass id=IbtnEnter
								style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
								type=image src="images/user_botton.gif" id="IbtnEnter"
								name="IbtnEnter">

						</LI>
					</UL>
				<DD id=user_bottom>
					<UL>
						<LI class=user_bottom_l>
						</LI>
						<LI class=user_bottom_c>
						</LI>
						<LI class=user_bottom_r>
						</LI>
					</UL>
				</DD>
			</DL>
		</DIV>
	</BODY>
</HTML>
